import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type homeResult = {
  page: any;
  result: any
};


/** 分页查询商城商品 */
export const shoppingmallselpage = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/shoppingmall/selpage"), { data });
};


/** 新增商城商品信息 */
export const shoppingmallinsershop = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/shoppingmall/insershop"), { data });
};

/** 修改商城商品信息 */
export const shoppingmallupdateshop = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/shoppingmall/updateshop"), { data });
};

/** 商城商品删除 */
export const shoppingmalldelshoppingmall = (id) => {
  return http.request<homeResult>("get", baseUrlApi(`/api/backend/shoppingmall/delshoppingmall/${id}`));
};


// /** 查询banner列表 */
// export const getselbanner = () => {
//   return http.request<homeResult>("get", baseUrlApi(`/api/backend/homepage/selbanner`));
// };



/** 分页查询经销商 */
export const authorizeddealerselpage = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/authorizeddealer/selpage"), { data });
};

/** 新增授权经销商 */
export const authorizeddealeraddauthorized = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/authorizeddealer/addauthorized"), { data });
};

/** 更新授权经销商 */
export const authorizeddealerupdateauthorized = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/authorizeddealer/updateauthorized"), { data });
};

/** 授权经销商删除 */
export const authorizeddealerdelinfo = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/api/backend/authorizeddealer/delinfo/${userid}`));
};
